/**
 *
 */
package com.oceansoft.mobile.econsole.modules.api.controller;

import com.oceansoft.mobile.econsole.modules.advice.entity.Advice;
import com.oceansoft.mobile.econsole.modules.advice.service.IAdviceService;
import com.oceansoft.mobile.econsole.modules.base.controller.BaseController;
import com.oceansoft.mobile.econsole.modules.base.entity.Result;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Date;

import static org.springframework.web.bind.annotation.RequestMethod.POST;

/**
 * 意见投诉接口
 *
 * @author jin.xu
 * @version 2014-08-06
 */
@RestController
@RequestMapping("api/advice")
public class ApiAdviceController extends BaseController {

    @Resource
    private IAdviceService adviceService;

    /**
     * 保存意见投诉
     */
    @ResponseBody
    @RequestMapping(value = "add" ,method = POST)
    public Result addAdvice(@RequestBody Advice advice) {
   
        advice.setCreateTime(new Date());
        return adviceService.save(advice);
    }
    

}
